home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / irix / cc_c++_make_csh / cpp.qr < prev    next >
Encoding:
Text File  |  1994-08-02  |  3.3 KB  |  73 lines

  1.     
  2.                          C pre-processor cheat sheet
  3.     
  4.     This file explains most of the C pre-processor directives, 
  5.     environment variables and predefined symbols.
  6.     
  7.     
  8.     PREPROCESSOR DIRECTIVES:
  9.     ------------------------
  10.     #ident "<string>"               [Ignored]
  11.     #define <macro-definition>      Define a macro or symbol.
  12.     #include {"<file>" | <<file>>}  Include a file.
  13.     #line <integer> [<file>]        Reset line number and, optionally the
  14.                                     name of the current file.
  15.     #undef <macro>                  Undefine a macro or symbol.
  16.     #pragma <local-pragma>          Do a locally defined function.  Only
  17.                                     pragmas defined:
  18.                                         once    Include file to be
  19.                                                 included once.
  20.     #endif                          End of "if" construct.
  21.     #ifdef <macro>                  "If" construct to be done only if
  22.                                     macro is defined.
  23.     #ifndef <macro>                 "If" construct to be done only if
  24.                                     macro is not defined.
  25.     #if <constant-expression>       "If" construct to be done if
  26.                                     expression is true.  Allows the
  27.                                     following constant-expressions:
  28.                                         ?:              Same as C construct.
  29.                                         defined <xyz>   Done if xyz defined.
  30.                                         defined (<xyz>) Done if xyz defined.
  31.     #elif <constant-expression>     "else-if" construct.
  32.     #else                           "else" construct.
  33.     #sccs                           Done only if SCCS file?
  34.     
  35.     
  36.     PREPROCESSOR ENVIRONMENT VARIABLES:
  37.     -----------------------------------
  38.     INCDIR          Directory to search for include files.
  39.     LIBDIR          Directory to search for libraries.
  40.     
  41.     
  42.     PREPROCESSOR PREDEFINED SYMBOLS:
  43.     --------------------------------
  44.     sgi
  45.     unix
  46.     __EXTENSIONS__  Extensions to ANSI C allowed (compiled with -xansi).
  47.     _SVR3           Version of unix.
  48.     SVR3            Version of unix.  Could also be:
  49.                             unix, dmart, gcos, ibm, os, tss, SVR2
  50.     mips            Destination computer.  Could also be:
  51.                             interdata, pdp11, u370, u3b, u3b5, u3b2,
  52.                             u3b20d, vax
  53.     _MIPSEB
  54.     MIPSEB
  55.     host_mips       Host computer.
  56.     LANGUAGE        Compiler being used.
  57.     _LANGUAGE       Compiler being used.  Could also be:
  58.                             LANGUAGE_C, LANGUAGE_ASSEMBLY,
  59.                             LANGUAGE_PASCAL, LANGUAGE_FORTRAN
  60.     lint            Defined if running lint.
  61.     
  62.     __LINE__        Current line being compiled.
  63.     __FILE__        Quoted file being compiled.
  64.     __DATE__        Quoted date being compiled.
  65.     __BASE_FILE__   Quoted base file being compiled.  If files are
  66.                     included, this is the original file.  Note that the
  67.                     symbol is not expanded until the line is actually
  68.                     compiled.
  69.     __INCLUDE_LEVEL__ Level of include files.
  70.     __VERSION__     Quoted version of compiler.
  71.     __TIME__        Quoted time of compile.
  72.     __STDC__        Defined if standard ANSI C compile without extensions.
  73.